import request from '@/utils/request'

/**
 * 查询服务详情
 * @returns {AxiosPromise}
 */
export function queryEntity(uid) {
  return request({
    url: 'rest/api/service/entity/details?uid=' + uid,
    method: 'get'
  })
}

/**
 * 收藏服务
 * @param data
 * @returns {AxiosPromise}
 */
export function saveCollection(data) {
  return request({
    url: 'rest/api/service/entity/collection',
    method: 'post',
    data: data
  })
}

/**
 * 保存咨询内容
 * @param data
 */
export function saveConsult(data) {
  return request({
    url: 'rest/api/service/entity/consult',
    method: 'post',
    data: data
  })
}

/**
 * 保存服务评价
 * @param data
 */
export function saveEvaluate(data) {
  return request({
    url: 'rest/api/service/entity/evluate',
    method: 'post',
    data: data
  })
}

/**
 * 保存服务评价
 * @param data
 */
export function queryVisit(data) {
  return request({
    url: 'rest/api/service/entity/visit',
    method: 'get',
    params: data
  })
}

/**
 * 保存服务评价
 * @param data
 */
export function queryEvaluate(data) {
  return request({
    url: 'rest/api/service/entity/evluate',
    method: 'get',
    params: data
  })
}

/**
 * 咨询内容查询
 * @param data
 * @returns {AxiosPromise}
 */
export function queryConsult(data) {
  return request({
    url: 'rest/api/service/entity/consult',
    method: 'get',
    params: data
  })
}

/**
 * 取消收藏
 * @param data
 * @returns {AxiosPromise}
 */
export function delCollection(data) {
  return request({
    url: 'rest/api/service/entity/collection/del',
    method: 'post',
    data: data
  })
}

export function queryWorkflow(data) {
  return request({
    url: 'rest/api/workflow/pager',
    method: 'get',
    params: data
  })
}

export default {
  queryEntity, saveCollection, saveConsult, delCollection, queryConsult, saveEvaluate, queryEvaluate, queryVisit, queryWorkflow
}
